package application

import (
	"tools.hezhuyun/checker/domain/entity"
	"tools.hezhuyun/checker/domain/repository"
)

type fileApp struct {
	repo repository.FileRepository
}

var _ FileAppInterface = &fileApp{}

type FileAppInterface interface {
	GetFile(uint64) (*entity.File, error)
	GetFilesByInnerCode(string) ([]*entity.File, error)
	CheckFileIsExist(*entity.File) bool
}

func (f *fileApp) GetFile(fileID uint64) (*entity.File, error) {
	return f.repo.GetFile(fileID)
}

func (f *fileApp) GetFilesByInnerCode(code string) ([]*entity.File, error) {
	return f.repo.GetFilesByInnerCode(code)
}

func (f *fileApp) CheckFileIsExist(file *entity.File) bool {
	return f.repo.CheckFileIsExist(file)
}
